-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Introduce coerce_container_to_any #14812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
r? llogiq |
This looks good for a start. Let's add the documentation and replace the |
9950e08
to
2363e9d
Compare
Thanks to guidance from @y21 on Zulip, I've got this as smart as I wanted. Seeking feedback particularly on lint name and description wording. I may iterate on the diagnostic a little more. |
2363e9d
to
18d86b3
Compare
Diagnostic is now pretty good. Not sure if there's a better way to format the expression type, e.g. so it shows up as |
4438e38
to
037945c
Compare
Future work: maybe this should also fire on coercing |
This comment has been minimized.
This comment has been minimized.
fa326e3
to
71bc081
Compare
Thanks to @fu5ha for expanded docs! |
71bc081
to
eef8a8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wonderful! I left some bikeshedding comments on the description and what not.
For the name, what about coerce_container_to_any
? I think using any_ref
to describe &Box<dyn Any>
is surprising
That would be path trimming, which we currently don't have. I'm on that, but you don't need to worry about it right now. |
eef8a8c
to
27eec99
Compare
Applied all feedback. Thanks for the reviews! |
This PR introduces a lint which detects when
&Box<dyn Any>
is coerced to&dyn Any
, which is usually a mistake where the intent was to directly pass thedyn Any
inside the box without coercion.changelog: [
coerce_container_to_any
]: introduce lintcc @llogiq
Remaining work:
Deref<Target=dyn Any>